#include <stdarg.h>
#include <qobject.h>
#include <qstring.h>
#include <pluginGl.h>
#include <functional>
#include <qsciscintilla.h>
#include <Scintilla.h>
#include <QInputDialog>

#include "NddPluginBridge.h"
#include "plugin_outline.h"

extern NddPluginBridge* pBridge;
extern std::function<QsciScintilla* (QWidget*)> s_getCurEdit;

int32_t ffi_set_outline_item (const char* p_name, int start_pos)
{
    if(pBridge == nullptr) {
        return -1;
    }

    if(pBridge->m_outlineDock) {
        PluginOutline* p_outline = dynamic_cast<PluginOutline*>(pBridge->m_outlineDock->widget());
        p_outline->set_outline_item(p_name, start_pos);

        return 0;
    }

    return -2;
}
